-
Notifications
You must be signed in to change notification settings - Fork 26
Conversation
2df257f
to
222d7f6
Compare
30b39b4
to
fbea07a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is GREAT!!!
@@ -186,10 +193,12 @@ export class TableBase<T extends {}> extends React.Component< | |||
this.setRowSelection(checkedItems); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we also need to doublecheck how selection works.
- We need to update
toggleChecked
, since it does include a client side sorting and assumes it has all the data while trying to map the checkbox the user clicked and the item that the row was about. - We probably also need to check
toggleAllChecked
as well, and maybe in server side more it should be returningall
, to let the consumer know that they need to query and fetch AAAAAALLLLLLLLLL item IDs from the backend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Work in progress. I need to merge this PR first to be able to do something like this in the following PR:
isDisabled & actionFn:
- isServerSide: false => T[]
- isServerSide: true =>
- selecting N items: { id: { $in: [] } }
- select-all: { $and: [{ belongs_to__application: xyz }, searchFilters] }
422d9d0
to
b307ce4
Compare
src/components/Table/TableBase.tsx
Outdated
const totalItems = items.length; | ||
const _itemsPerPage = itemsPerPage || 50; | ||
const totalItems = serverSide ? pagination?.totalItems : items.length; | ||
const itemsPerPage = pagination?.itemsPerPage || DEFAULT_ITEMS_PER_PAGE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this is a minor & itemsPerPage
is still in the properties, we should
const itemsPerPage = pagination?.itemsPerPage || DEFAULT_ITEMS_PER_PAGE; | |
const itemsPerPage = pagination?.itemsPerPage ?? this.props.itemsPerPage ?? DEFAULT_ITEMS_PER_PAGE; |
both here and in setPage
.
Otherwise we can do a major and remove it completely.
I think atm I'm in favor of the minor so that we can do a single major after the product call on how selection should work.
Change-type: minor Signed-off-by: Andrea Rosci <[email protected]>
b307ce4
to
667f21a
Compare
Change-type: patch Signed-off-by: Andrea Rosci <[email protected]>
667f21a
to
f169c31
Compare
Connects-to: #
See:
Depends-on:
Change-type: major|minor|patch
Contributor checklist
npm run generate-snapshots
Reviewer Guidelines